home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / modula2 / inout20.zip / newinout.def < prev   
Text File  |  1994-06-14  |  6KB  |  97 lines

  1. DEFINITION MODULE NewInOut;
  2. (* Definition module for a comfortable character in- and output        *)
  3. (* System : Gardens Point Modula                                       *)
  4. (* Created: 05.06.1994                                                 *)
  5. (* Author : Roland Ortloff                                             *)
  6. (* This file may not be - even not parts of it - changed in any way.   *)
  7. (* Please feel free to distribute it among your friends as long as you *)
  8. (* keep all the files together without any changes.                    *)
  9. (*                                         Copyright by Roland Ortloff *)
  10.  
  11. (* This program comes without any warranty. Your are using it at your own    *)
  12. (* risk. You may use, copy and distribute this program without restrictions  *)
  13. (* but only in an unmodified way and without charging money for it. Making   *)
  14. (* copies of the source code is forbidden unless copying it for your own use *)
  15. (* and not giving it to another person, neither for money nor for free.      *)
  16. (* It is also strictly forbidden to disassemble any part of this program.    *)
  17.  
  18.  
  19.  PROCEDURE ReadZahl(VAR Summe : INTEGER; Links, Rechts, Breite : INTEGER);
  20.  (* Reads an Integer (positive or negative) with a lower (Links) and a      *)
  21.  (* higher (Rechts) limit only allowing digits and one time a '-' only      *)
  22.  (* in the beginning of the input.                                          *)
  23.  (* The width of the input on the screen is limited by the width of the     *)
  24.  (* little window (Breite). So your input scrolls inside the window.        *)
  25.  (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
  26.  (* by at least 1 higher than the longest possible input.                   *)
  27.  (* The extra spot is reserved for the cursor !!!                           *)
  28.  
  29.  
  30.  PROCEDURE ReadReell(VAR Zahl : REAL; Links, Rechts : REAL;
  31.                          Max, Breite : INTEGER);
  32.  (* Reads a Real-Number (positive or negative) with a lower (Links) and a   *)
  33.  (* higher (Rechts) limit only allowing digits and one time a '-' only in   *)
  34.  (* the beginning of the input and one time a ','.                          *)
  35.  (* The width of the input on the screen is limited by the width of the     *)
  36.  (* little window (Breite). So your input scrolls inside the window.        *)
  37.  (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
  38.  (* by at least 1 higher than the longest possible input.                   *)
  39.  (* The extra spot is reserved for the cursor !!!                           *)
  40.  (* Your Real-Number will have at most (Max) characters, including the '-'  *)
  41.  (* and the ','. This is helpful if you want to format your output on the   *)
  42.  (* screen like creating matrixes or something else.                        *)
  43.  
  44.  PROCEDURE WriteReell(Zahl : REAL; Stellen, Bund : INTEGER);
  45.  (* Prints a REAL-number with at most (Stellen) digits after the comma *)
  46.  (* with an orientation to the right of (Bund) digits as a regular     *)
  47.  (* number, e.g. 4.4624e-02 will be printed as 0.04624                 *)
  48.  
  49.  
  50.  PROCEDURE ReadKette    (VAR Kette : ARRAY OF CHAR; Erlaubt : ARRAY OF CHAR;
  51.                              Max, Breite : INTEGER);
  52.  (* Reads a String (Kette) only containing characters included in           *)
  53.  (* (Erlaubt) with a maximal number of characters (Max).                    *)
  54.  (* The width of the input on the screen is limited by the width of the     *)
  55.  (* little window (Breite). So your input scrolls inside the window.        *)
  56.  (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
  57.  (* by at least 1 higher than the longest possible input.                   *)
  58.  (* The extra spot is reserved for the cursor !!!                           *)
  59.  (* In case you want to allow basically all of the possible characters,     *)
  60.  (* you may run the command instead of mentioning all the characters in the *)
  61.  (* parameter >Erlaubt< for the allowed keys by running it with 'Alles'.    *)
  62.  (* So basically all of the characters will be allowed.                     *)
  63.  (* Remember that the variable Kette is at least one array bigger than      *)
  64.  (* the actual input will have characters, because an additional NIL-       *)
  65.  (* character will be added to mark the end of the STRING.                  *)
  66.  
  67.  
  68.  PROCEDURE ReadKetteVoll(VAR Kette : ARRAY OF CHAR; Erlaubt : ARRAY OF CHAR;
  69.                              Max, Breite : INTEGER);
  70.  (* Same as ReadKette except one addition:                                  *)
  71.  (* However this time it fills the String with blanks until the Length Max. *)
  72.  
  73.  
  74.  PROCEDURE Pause;
  75.  (* Waits until keypressed *)
  76.  
  77.  
  78. (* If you're interested in the source code of the program e.g. in order  *)
  79. (* to compile it on a different system or to translate it into different *)
  80. (* languages with the help of the documentation, you should send me a    *)
  81. (* small donation of DM 10,- or $ 8,- along with your e-mail address or  *)
  82. (* a correctly prepaid envelope containing a disk to send back to you.   *)
  83. (* !!! You'll never need 'Read' and 'ReadInt' in your life anymore !!!   *)
  84.  
  85. (* If you have any comments, wishes, bugs or whatever, please feel free  *)
  86. (* to drop me a line. I'll be glad to here something from you, even if   *)
  87. (* you might not like this tool, what I really can't imagine.            *)
  88.  
  89. (* Just send your e-mail to one of the following e-mail-adresses:       *)
  90. (*     1) ortlofrd@trick.informatik.uni-stuttgart.de                    *)
  91. (* or: 2) zcrk1121@rpool1.rus.uni-stuttgart.de (if anything else fails) *)
  92.  
  93. (* The newest version is always available at:                           *)
  94. (* ftp.uni-erlangen.de: /pub/pc/msdos/languages/modula                  *)
  95.  
  96. END NewInOut.
  97.